<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<h:inputHidden id="#{id}id" value="#{entityId}" />
	<h:panelGrid columns="3">
		<p:selectOneMenu id="#{id}pais" style="min-width: 200px;">
			<f:selectItem itemLabel="País" itemValue="" />
		</p:selectOneMenu>
		<p:selectOneMenu id="#{id}estado" style="min-width: 200px;">
			<f:selectItem itemLabel="Estado" itemValue="" />
		</p:selectOneMenu>
		<p:selectOneMenu style="min-width: 200px;">
			<f:selectItem id="#{id}municipio" itemLabel="Município" itemValue="" />
		</p:selectOneMenu>
		<p:selectOneMenu style="min-width: 200px;">
			<f:selectItem id="#{id}cidade" itemLabel="Cidade" itemValue="" />
		</p:selectOneMenu>
		<p:selectOneMenu id="#{id}bairro" style="min-width: 200px;">
			<f:selectItem itemLabel="Bairro" itemValue="" />
		</p:selectOneMenu>
		<p:inputText id="#{id}cep" style="min-width: 200px;" />
		<p:inputText id="#{id}logradouro" style="min-width: 200px;" />
		<p:inputText id="#{id}complemento" style="min-width: 200px;" />
		<p:inputText id="#{id}numero" style="min-width: 200px;" />
		<p:inputText id="#{id}latitude" style="min-width: 200px;" />
		<p:inputText id="#{id}longitude" style="min-width: 200px;" />
		<p:commandButton value="Exibir no Mapa"
			onclick="#{id}mapDialog.show();" />
	</h:panelGrid>

	<p:watermark for="#{id}cep" value="CEP" />
	<p:watermark for="#{id}logradouro" value="Logradouro" />
	<p:watermark for="#{id}complemento" value="Complemento" />
	<p:watermark for="#{id}numero" value="Número" />
	<p:watermark for="#{id}latitude" value="Latitude" />
	<p:watermark for="#{id}longitude" value="Longitude" />

	<p:tooltip for="#{id}pais" value="País do endereço" />
	<p:tooltip for="#{id}estado" value="Estado/UF do endereço" />
	<p:tooltip for="#{id}municipio" value="Município do endereço" />
	<p:tooltip for="#{id}cidade" value="Cidade do endereço" />
	<p:tooltip for="#{id}bairro" value="Bairro do endereço" />
	<p:tooltip for="#{id}cep" value="Número do CEP do endereço" />
	<p:tooltip for="#{id}logradouro" value="Logradouro do endereço" />
	<p:tooltip for="#{id}complemento" value="Complemento do endereço" />
	<p:tooltip for="#{id}numero" value="Número do endereço" />
	<p:tooltip for="#{id}latitude" value="Latitude do endereço" />
	<p:tooltip for="#{id}longitude" value="Longitude do endereço" />

	<p:dialog id="#{id}mapDialog" header="Mapa de Localização"
		widgetVar="#{id}mapDialog" modal="false">

		<p:gmap id="#{id}map" center="-15.565986,-54.309782" zoom="15"
			type="HYBRID" style="width:600px;height:400px">
			<p:ajax event="pointSelect" listener="#{pessoasMB.pontoSelecionado}" />
		</p:gmap>

		<p:commandButton id="#{id}ok" value="Ok"
			oncomplete="#{id}mapDialog.hide();" />
		<p:commandButton id="#{id}cancel" value="Cancelar"
			oncomplete="#{id}mapDialog.hide();" />
	</p:dialog>

</ui:component>